/*  
 * cafe-css.js
 * @Author :      PANRUSEN
 * @CreateDate :  2017年6月8日
 * Copyright (c) 2017, NRIET.
 * 		css加载模块　合并加载，暂时自定义
 */

define( 'css', {
	 load: function (Url, keyid) {
		 var tag = document.getElementById(keyid + "_css");
		 if(tag) return;
		 var link = document.createElement('link');
		 try {
			 link.setAttribute('rel', 'stylesheet');
			 link.setAttribute('type', 'text/css');
			 link.setAttribute('href', Url);
			 link.setAttribute('crossorigin', 'anonymous');
			 link.setAttribute('id', keyid + "_css");
			 var parent = document.getElementsByTagName('head')[0] || document.body;
			 parent.appendChild(link);
			 parent = null;
			 link = null;
		 } catch (e) {
			 link = null;
			 ErrorUtil.cfThrow(e);
		 }
	 }
});
